import 'package:flutter_test/flutter_test.dart';
import 'package:component_getui/component_getui.dart';
import 'package:component_getui/component_getui_platform_interface.dart';
import 'package:component_getui/component_getui_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentGetuiPlatform
    with MockPlatformInterfaceMixin
    implements ComponentGetuiPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentGetuiPlatform initialPlatform = ComponentGetuiPlatform.instance;

  test('$MethodChannelComponentGetui is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentGetui>());
  });

  test('getPlatformVersion', () async {
    ComponentGetui componentGetuiPlugin = ComponentGetui();
    MockComponentGetuiPlatform fakePlatform = MockComponentGetuiPlatform();
    ComponentGetuiPlatform.instance = fakePlatform;

    expect(await componentGetuiPlugin.getPlatformVersion(), '42');
  });
}
